cc.Class({
    extends: cc.Component,

    properties: {
        _createroom_node: null,
        
        createroom_node: {
            get: function () {
                return this._createroom_node;
            },
            set: function (value) {
                this._createroom_node = value;
            },
        },
    },

    onLoad: function () {
        //屏蔽底部点击事件
        cc.find('mask', this.node).on(cc.Node.EventType.TOUCH_START, function (event) {});
    },

    //关闭
    onClose: function () {
        this.node.destroy();
    },
    
    //确定
    onSure: function () {
        for (let i = 1; i < 4; i++) {
            var toggle = cc.find("choosemapai_bg/toggle" + i, this.node);
            if (toggle.getComponent(cc.Toggle).isChecked) {
               this._createroom_node.onSetMapai(i);
            }
        }
        this.node.destroy();
    },
});
